const URL='http://localhost:8081'

module.exports={
  getPhoneBooks:async ()=>{
    const {data:res}= await wx.p.request({
      url: URL+'/phoneBook',
      method:'get'
    })
    return res
  },
  getSearchPhoneBooks:async (keyword)=>{
    const {data:res}= await wx.p.request({
      url: URL+'/phoneBook/'+keyword,
      method:'get'
    })
    return res
  },

  addPhoneBook:async (phone)=>{
    const {data:res}= await wx.p.request({
      url: URL+'/phoneBook',
      method:'post',
      data:phone
    })
  },
  getPhoneBooksByGroup:async (phone)=>{
    const {data:res}= await wx.p.request({
      url: URL+'/phoneBook/group',
      method:'get'
    })
    return res
  }
}